Field of the Invention
The present invention relates to an image processing apparatus that operates a plurality of applications, a control method thereof, and a storage medium.
Description of the Related Art
An increasing number of current multifunction peripherals (MFPs) have a function of executing applications, apart from functions incorporated in MFPs, such as copying, scanning and printing of documents. Many MFPs have a Java execution environment as an application execution environment, and are able to execute applications written in Java (registered trademark). Exemplary application execution environments include MEAP (registered trademark) developed by Canon (registered trademark).
Whereas applications are executed with one process per application in the case of Java applications on a PC, many MFPs execute a plurality of applications with one Java process using an OSGi framework or the like because of CPU or memory restrictions. Thus, when a bug in one of the applications being executed on an MFP results in a memory leak, an OutOfMemoryError could occur, causing all the applications to stop. Also, an OutOfMemoryError occurs in the case where there is no memory to allocate when an application requests memory, and thus may occur during execution of an application that is running smoothly. Thus, it is difficult to specify the application that is causing the memory leak.
Japanese Patent Laid-Open No. 2005-269439 proposes a technology for measuring memory every thread. However, in a case such as where one thread executes the codes of a plurality of applications as shown in FIG. 13 discussed later, the used memory for each application cannot be measured.
At present, the following two methods are conceivable in order to find a memory leak. One method involves using a tool called a profiler to monitor the state of objects generated by applications. The other method involves dumping the contents of heap memory that is used by a Java VM (hereinafter, “heap dumping”) and analyzing objects generated by applications.
Of these methods, since monitoring the state of objects using a profiler greatly reduces the execution speed of applications, application to an MFP in which the CPU or memory is very restricted is problematic. Thus, the technique of executing heap dumping and analyzing objects generated by applications has been used. Similarly, disk capacity available for use as the application execution environment is predetermined in some cases. In the case of Disk Full, the situation is not automatically restored even when the MFP is restarted, unlike a memory leak. Thus, a technology in which applications declare usage in advance and installation restrictions are implemented so as to not exceed this usage is disclosed in “iR-ADV Manuals” (Canon, “Installing an Application” page, “Using an Application” page (viewed on May 17, 2013), Internet <URL: http://cweb.canon.jp/manual/ir-adv/>.
However, the following problems exist with the above conventional technologies. With conventional heap dumping, acquired heap dumping information is taken from the device and analyzed to locate the application causing the memory leak, and the amount of memory that is used by applications is aggregated. Thus, the memory usage of individual applications cannot be known in real-time. On the other hand, with the profiler, since the execution speed of the applications drops off greatly, realistically it is difficult to measure the memory amount that is used by each application in real-time.
Even in the case where the applications declare disk usage in advance and installation restrictions are implemented so as to not exceed this usage, one of the applications being executed on the MFP could have a bug and the entire application execution environment could be placed in a disk full state. In this case, a write error occurs even in the bug-free applications, and normal operations may no longer be possible.